{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "84647296-57fe-4c49-ad47-56ed48295c63",
   "metadata": {},
   "outputs": [],
   "source": [
    "class Query(object):\n",
    "    def __init__(self,name):\n",
    "        self.name = name \n",
    "\n",
    "    def __enter__(self): \n",
    "        print('begin')\n",
    "        return self\n",
    "    def __exit__(self, exc_type, exc_value, traceback): \n",
    "        if exc_type: \n",
    "            print('Error')\n",
    "        else: \n",
    "            print('End')\n",
    "\n",
    "    def query(self):\n",
    "        print('query info about %s ... ' % self.name)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "76bdc264-37c1-4db3-808e-a844be18038a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "begin\n",
      "query info about Bob ... \n",
      "End\n"
     ]
    }
   ],
   "source": [
    "with Query('Bob') as q:\n",
    "    q.query()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ddca577e-e507-407f-ba47-e0e5aac2d997",
   "metadata": {},
   "outputs": [],
   "source": [
    "from contextlib import contextmanager\n",
    "\n",
    "class Query(object):\n",
    "    def __init__(self, name):\n",
    "        self.name = name \n",
    "\n",
    "    def query(self):\n",
    "        print('Query info about %s...' % self.name)\n",
    "\n",
    "@contextmanager\n",
    "def create_query(name):\n",
    "    print('Begin')\n",
    "    q = Query(name)\n",
    "    yield q \n",
    "\n",
    "    print('end')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "d14af387-ca3a-4012-83ef-d32041ed8f35",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Begin\n",
      "Query info about Bob...\n",
      "end\n"
     ]
    }
   ],
   "source": [
    "with create_query('Bob') as q:\n",
    "    q.query()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "debfbe57-1c7a-4106-a9d7-da5e5c3c55c5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "b'<!doctype html>\\n'\n",
      "b'<!--[if lt IE 7]>   <html class=\"no-js ie6 lt-ie7 lt-ie8 lt-ie9\">   <![endif]-->\\n'\n",
      "b'<!--[if IE 7]>      <html class=\"no-js ie7 lt-ie8 lt-ie9\">          <![endif]-->\\n'\n",
      "b'<!--[if IE 8]>      <html class=\"no-js ie8 lt-ie9\">                 <![endif]-->\\n'\n",
      "b'<!--[if gt IE 8]><!--><html class=\"no-js\" lang=\"en\" dir=\"ltr\">  <!--<![endif]-->\\n'\n",
      "b'\\n'\n",
      "b'<head>\\n'\n",
      "b'    <!-- Google tag (gtag.js) -->\\n'\n",
      "b'    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-TF35YF9CVH\"></script>\\n'\n",
      "b'    <script>\\n'\n",
      "b'      window.dataLayer = window.dataLayer || [];\\n'\n",
      "b'      function gtag(){dataLayer.push(arguments);}\\n'\n",
      "b\"      gtag('js', new Date());\\n\"\n",
      "b\"      gtag('config', 'G-TF35YF9CVH');\\n\"\n",
      "b'    </script>\\n'\n",
      "b'    <!-- Plausible.io analytics -->\\n'\n",
      "b'    <script defer data-domain=\"python.org\" src=\"https://plausible.io/js/script.js\"></script>\\n'\n",
      "b'\\n'\n",
      "b'    <meta charset=\"utf-8\">\\n'\n",
      "b'    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\\n'\n",
      "b'\\n'\n",
      "b'    <link rel=\"prefetch\" href=\"//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js\">\\n'\n",
      "b'    <link rel=\"prefetch\" href=\"//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js\">\\n'\n",
      "b'\\n'\n",
      "b'    <meta name=\"application-name\" content=\"Python.org\">\\n'\n",
      "b'    <meta name=\"msapplication-tooltip\" content=\"The official home of the Python Programming Language\">\\n'\n",
      "b'    <meta name=\"apple-mobile-web-app-title\" content=\"Python.org\">\\n'\n",
      "b'    <meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\\n'\n",
      "b'    <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\">\\n'\n",
      "b'\\n'\n",
      "b'    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\\n'\n",
      "b'    <meta name=\"HandheldFriendly\" content=\"True\">\\n'\n",
      "b'    <meta name=\"format-detection\" content=\"telephone=no\">\\n'\n",
      "b'    <meta http-equiv=\"cleartype\" content=\"on\">\\n'\n",
      "b'    <meta http-equiv=\"imagetoolbar\" content=\"false\">\\n'\n",
      "b'\\n'\n",
      "b'    <script async\\n'\n",
      "b'            src=\"https://media.ethicalads.io/media/client/v1.4.0/ethicalads.min.js\"\\n'\n",
      "b'            integrity=\"sha256-U3hKDidudIaxBDEzwGJApJgPEf2mWk6cfMWghrAa6i0= sha384-UcmsCqcNRSLW/dV3Lo1oCi2/VaurXbib6p4HyUEOeIa/4OpsrnucrugAefzVZJfI sha512-q4t1L4xEjGV2R4hzqCa41P8jrgFUS8xTb8rdNv4FGvw7FpydVj/kkxBJHOiaoxHa8olCcx1Slk9K+3sNbsM4ug==\"\\n'\n",
      "b'            crossorigin=\"anonymous\"\\n'\n",
      "b'    ></script>\\n'\n",
      "b'    <script src=\"/static/js/libs/modernizr.js\"></script>\\n'\n",
      "b'\\n'\n",
      "b'    <link href=\"/static/stylesheets/style.08a078d0aa02.css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" title=\"default\" />\\n'\n",
      "b'    <link href=\"/static/stylesheets/mq.98d6092b2ada.css\" rel=\"stylesheet\" type=\"text/css\" media=\"not print, braille, embossed, speech, tty\" />\\n'\n",
      "b'    <link href=\"/static/stylesheets/no-mq.bf0c425cdb73.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\\n'\n",
      "b'    \\n'\n",
      "b'\\n'\n",
      "b'    <!--[if (lte IE 8)&(!IEMobile)]>\\n'\n",
      "b'    <link href=\"/static/stylesheets/no-mq.bf0c425cdb73.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    <![endif]-->\\n'\n",
      "b'    <link rel=\"stylesheet\" href=\"//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css\">\\n'\n",
      "b'\\n'\n",
      "b'    \\n'\n",
      "b'    <link rel=\"icon\" type=\"image/x-icon\" href=\"/static/favicon.ico\">\\n'\n",
      "b'    <link rel=\"apple-touch-icon-precomposed\" sizes=\"144x144\" href=\"/static/apple-touch-icon-144x144-precomposed.png\">\\n'\n",
      "b'    <link rel=\"apple-touch-icon-precomposed\" sizes=\"114x114\" href=\"/static/apple-touch-icon-114x114-precomposed.png\">\\n'\n",
      "b'    <link rel=\"apple-touch-icon-precomposed\" sizes=\"72x72\" href=\"/static/apple-touch-icon-72x72-precomposed.png\">\\n'\n",
      "b'    <link rel=\"apple-touch-icon-precomposed\" href=\"/static/apple-touch-icon-precomposed.png\">\\n'\n",
      "b'    <link rel=\"apple-touch-icon\" href=\"/static/apple-touch-icon-precomposed.png\">\\n'\n",
      "b'\\n'\n",
      "b'    \\n'\n",
      "b'    <meta name=\"msapplication-TileImage\" content=\"/static/metro-icon-144x144.png\"><!-- white shape -->\\n'\n",
      "b'    <meta name=\"msapplication-TileColor\" content=\"#3673a5\"><!-- python blue -->\\n'\n",
      "b'    <meta name=\"msapplication-navbutton-color\" content=\"#3673a5\">\\n'\n",
      "b'\\n'\n",
      "b'    <title>Welcome to Python.org</title>\\n'\n",
      "b'\\n'\n",
      "b'    <meta name=\"description\" content=\"The official home of the Python Programming Language\">\\n'\n",
      "b'    <meta name=\"keywords\" content=\"Python programming language object oriented web free open source software license documentation download community\">\\n'\n",
      "b'\\n'\n",
      "b'    \\n'\n",
      "b'    <meta property=\"og:type\" content=\"website\">\\n'\n",
      "b'    <meta property=\"og:site_name\" content=\"Python.org\">\\n'\n",
      "b'    <meta property=\"og:title\" content=\"Welcome to Python.org\">\\n'\n",
      "b'    <meta property=\"og:description\" content=\"The official home of the Python Programming Language\">\\n'\n",
      "b'    \\n'\n",
      "b'    <meta property=\"og:image\" content=\"https://www.python.org/static/opengraph-icon-200x200.png\">\\n'\n",
      "b'    <meta property=\"og:image:secure_url\" content=\"https://www.python.org/static/opengraph-icon-200x200.png\">\\n'\n",
      "b'    \\n'\n",
      "b'    <meta property=\"og:url\" content=\"https://www.python.org/\">\\n'\n",
      "b'\\n'\n",
      "b'    <link rel=\"author\" href=\"/humans.txt\">\\n'\n",
      "b'\\n'\n",
      "b'    <link rel=\"alternate\" type=\"application/rss+xml\" title=\"Python Enhancement Proposals\"\\n'\n",
      "b'          href=\"https://peps.python.org/peps.rss\">\\n'\n",
      "b'    <link rel=\"alternate\" type=\"application/rss+xml\" title=\"Python Job Opportunities\"\\n'\n",
      "b'          href=\"https://www.python.org/jobs/feed/rss/\">\\n'\n",
      "b'    <link rel=\"alternate\" type=\"application/rss+xml\" title=\"Python Software Foundation News\"\\n'\n",
      "b'          href=\"https://feeds.feedburner.com/PythonSoftwareFoundationNews\">\\n'\n",
      "b'    <link rel=\"alternate\" type=\"application/rss+xml\" title=\"Python Insider\"\\n'\n",
      "b'          href=\"https://feeds.feedburner.com/PythonInsider\">\\n'\n",
      "b'   <link rel=\"alternate\" type=\"application/rss+xml\" title=\"Python Releases\"\\n'\n",
      "b'         href=\"https://www.python.org/downloads/feed.rss\">\\n'\n",
      "b'\\n'\n",
      "b'    \\n'\n",
      "b'\\n'\n",
      "b'    \\n'\n",
      "b'    <script type=\"application/ld+json\">\\n'\n",
      "b'     {\\n'\n",
      "b'       \"@context\": \"https://schema.org\",\\n'\n",
      "b'       \"@type\": \"WebSite\",\\n'\n",
      "b'       \"url\": \"https://www.python.org/\",\\n'\n",
      "b'       \"potentialAction\": {\\n'\n",
      "b'         \"@type\": \"SearchAction\",\\n'\n",
      "b'         \"target\": \"https://www.python.org/search/?q={search_term_string}\",\\n'\n",
      "b'         \"query-input\": \"required name=search_term_string\"\\n'\n",
      "b'       }\\n'\n",
      "b'     }\\n'\n",
      "b'    </script>\\n'\n",
      "b'\\n'\n",
      "b'    \\n'\n",
      "b'    <script type=\"text/javascript\">\\n'\n",
      "b'    var _gaq = _gaq || [];\\n'\n",
      "b\"    _gaq.push(['_setAccount', 'UA-39055973-1']);\\n\"\n",
      "b\"    _gaq.push(['_trackPageview']);\\n\"\n",
      "b'\\n'\n",
      "b'    (function() {\\n'\n",
      "b\"        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\\n\"\n",
      "b\"        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\\n\"\n",
      "b\"        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\\n\"\n",
      "b'    })();\\n'\n",
      "b'    </script>\\n'\n",
      "b'    \\n'\n",
      "b'</head>\\n'\n",
      "b'\\n'\n",
      "b'<body class=\"python home\" id=\"homepage\">\\n'\n",
      "b'\\n'\n",
      "b'    <div id=\"touchnav-wrapper\">\\n'\n",
      "b'\\n'\n",
      "b'        <div id=\"nojs\" class=\"do-not-print\">\\n'\n",
      "b'            <p><strong>Notice:</strong> While JavaScript is not essential for this website, your interaction with the content will be limited. Please turn JavaScript on for the full experience. </p>\\n'\n",
      "b'        </div>\\n'\n",
      "b'\\n'\n",
      "b'        <!--[if lte IE 8]>\\n'\n",
      "b'        <div id=\"oldie-warning\" class=\"do-not-print\">\\n'\n",
      "b'            <p>\\n'\n",
      "b'                <strong>Notice:</strong> Your browser is <em>ancient</em>. Please\\n'\n",
      "b'                <a href=\"http://browsehappy.com/\">upgrade to a different browser</a> to experience a better web.\\n'\n",
      "b'            </p>\\n'\n",
      "b'        </div>\\n'\n",
      "b'        <![endif]-->\\n'\n",
      "b'\\n'\n",
      "b'        <!-- Sister Site Links -->\\n'\n",
      "b'        <div id=\"top\" class=\"top-bar do-not-print\">\\n'\n",
      "b'\\n'\n",
      "b'            <nav class=\"meta-navigation container\" role=\"navigation\">\\n'\n",
      "b'\\n'\n",
      "b'                \\n'\n",
      "b'                <div class=\"skip-link screen-reader-text\">\\n'\n",
      "b'                    <a href=\"#content\" title=\"Skip to content\">Skip to content</a>\\n'\n",
      "b'                </div>\\n'\n",
      "b'\\n'\n",
      "b'                \\n'\n",
      "b'                <a id=\"close-python-network\" class=\"jump-link\" href=\"#python-network\" aria-hidden=\"true\">\\n'\n",
      "b'                    <span aria-hidden=\"true\" class=\"icon-arrow-down\"><span>&#9660;</span></span> Close\\n'\n",
      "b'                </a>\\n'\n",
      "b'\\n'\n",
      "b'                \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"menu\" role=\"tree\">\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"python-meta current_item selectedcurrent_branch selected\">\\n'\n",
      "b'        <a href=\"/\" title=\"The Python Programming Language\" class=\"current_item selectedcurrent_branch selected\">Python</a>\\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"psf-meta \">\\n'\n",
      "b'        <a href=\"https://www.python.org/psf/\" title=\"The Python Software Foundation\" >PSF</a>\\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"docs-meta \">\\n'\n",
      "b'        <a href=\"https://docs.python.org\" title=\"Python Documentation\" >Docs</a>\\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"pypi-meta \">\\n'\n",
      "b'        <a href=\"https://pypi.org/\" title=\"Python Package Index\" >PyPI</a>\\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"jobs-meta \">\\n'\n",
      "b'        <a href=\"/jobs/\" title=\"Python Job Board\" >Jobs</a>\\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"shop-meta \">\\n'\n",
      "b'        <a href=\"/community/\"  >Community</a>\\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'\\n'\n",
      "b'                <a id=\"python-network\" class=\"jump-link\" href=\"#top\" aria-hidden=\"true\">\\n'\n",
      "b'                    <span aria-hidden=\"true\" class=\"icon-arrow-up\"><span>&#9650;</span></span> The Python Network\\n'\n",
      "b'                </a>\\n'\n",
      "b'\\n'\n",
      "b'            </nav>\\n'\n",
      "b'\\n'\n",
      "b'        </div>\\n'\n",
      "b'\\n'\n",
      "b'        <!-- Header elements -->\\n'\n",
      "b'        <header class=\"main-header\" role=\"banner\">\\n'\n",
      "b'            <div class=\"container\">\\n'\n",
      "b'\\n'\n",
      "b'                <h1 class=\"site-headline\">\\n'\n",
      "b'                    <a href=\"/\"><img class=\"python-logo\" src=\"/static/img/python-logo.png\" alt=\"python&trade;\"></a>\\n'\n",
      "b'                </h1>\\n'\n",
      "b'\\n'\n",
      "b'                <div class=\"options-bar-container do-not-print\">\\n'\n",
      "b'                    <a href=\"https://psfmember.org/civicrm/contribute/transact?reset=1&id=2\" class=\"donate-button\">Donate</a>\\n'\n",
      "b'                    <div class=\"options-bar\">\\n'\n",
      "b'                        \\n'\n",
      "b'                        <a id=\"site-map-link\" class=\"jump-to-menu\" href=\"#site-map\"><span class=\"menu-icon\">&equiv;</span> Menu</a><form class=\"search-the-site\" action=\"/search/\" method=\"get\">\\n'\n",
      "b'                            <fieldset title=\"Search Python.org\">\\n'\n",
      "b'\\n'\n",
      "b'                                <span aria-hidden=\"true\" class=\"icon-search\"></span>\\n'\n",
      "b'\\n'\n",
      "b'                                <label class=\"screen-reader-text\" for=\"id-search-field\">Search This Site</label>\\n'\n",
      "b'                                <input id=\"id-search-field\" name=\"q\" type=\"search\" role=\"textbox\" class=\"search-field\" placeholder=\"Search\" value=\"\" tabindex=\"1\">\\n'\n",
      "b'\\n'\n",
      "b'                                <button type=\"submit\" name=\"submit\" id=\"submit\" class=\"search-button\" title=\"Submit this Search\" tabindex=\"3\">\\n'\n",
      "b'                                    GO\\n'\n",
      "b'                                </button>\\n'\n",
      "b'\\n'\n",
      "b'                                \\n'\n",
      "b'                                <!--[if IE]><input type=\"text\" style=\"display: none;\" disabled=\"disabled\" size=\"1\" tabindex=\"4\"><![endif]-->\\n'\n",
      "b'\\n'\n",
      "b'                            </fieldset>\\n'\n",
      "b'                        </form><span class=\"breaker\"></span><div class=\"adjust-font-size\" aria-hidden=\"true\">\\n'\n",
      "b'                            <ul class=\"navigation menu\" aria-label=\"Adjust Text Size on Page\">\\n'\n",
      "b'                                <li class=\"tier-1 last\" aria-haspopup=\"true\">\\n'\n",
      "b'                                    <a href=\"#\" class=\"action-trigger\"><strong><small>A</small> A</strong></a>\\n'\n",
      "b'                                    <ul class=\"subnav menu\">\\n'\n",
      "b'                                        <li class=\"tier-2 element-1\" role=\"treeitem\"><a class=\"text-shrink\" title=\"Make Text Smaller\" href=\"javascript:;\">Smaller</a></li>\\n'\n",
      "b'                                        <li class=\"tier-2 element-2\" role=\"treeitem\"><a class=\"text-grow\" title=\"Make Text Larger\" href=\"javascript:;\">Larger</a></li>\\n'\n",
      "b'                                        <li class=\"tier-2 element-3\" role=\"treeitem\"><a class=\"text-reset\" title=\"Reset any font size changes I have made\" href=\"javascript:;\">Reset</a></li>\\n'\n",
      "b'                                    </ul>\\n'\n",
      "b'                                </li>\\n'\n",
      "b'                            </ul>\\n'\n",
      "b'                        </div><div class=\"winkwink-nudgenudge\">\\n'\n",
      "b'                            <ul class=\"navigation menu\" aria-label=\"Social Media Navigation\">\\n'\n",
      "b'                                <li class=\"tier-1 last\" aria-haspopup=\"true\">\\n'\n",
      "b'                                    <a href=\"#\" class=\"action-trigger\">Socialize</a>\\n'\n",
      "b'                                    <ul class=\"subnav menu\">\\n'\n",
      "b'                                        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"https://www.linkedin.com/company/python-software-foundation/\"><i aria-hidden=\"true\" class=\"fa fa-linkedin-square\"></i>LinkedIn</a></li>\\n'\n",
      "b'                                        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"https://fosstodon.org/@ThePSF\"><span aria-hidden=\"true\" class=\"icon-mastodon\"></span>Mastodon</a></li>\\n'\n",
      "b'                                        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"/community/irc/\"><span aria-hidden=\"true\" class=\"icon-freenode\"></span>Chat on IRC</a></li>\\n'\n",
      "b'                                        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"https://twitter.com/ThePSF\"><span aria-hidden=\"true\" class=\"icon-twitter\"></span>Twitter</a></li>\\n'\n",
      "b'                                    </ul>\\n'\n",
      "b'                                </li>\\n'\n",
      "b'                            </ul>\\n'\n",
      "b'                        </div>\\n'\n",
      "b'                        <span data-html-include=\"/authenticated\"></span>\\n'\n",
      "b'                    </div><!-- end options-bar -->\\n'\n",
      "b'                </div>\\n'\n",
      "b'\\n'\n",
      "b'                <nav id=\"mainnav\" class=\"python-navigation main-navigation do-not-print\" role=\"navigation\">\\n'\n",
      "b'                    \\n'\n",
      "b'                        \\n'\n",
      "b'<ul class=\"navigation menu\" role=\"menubar\" aria-label=\"Main Navigation\">\\n'\n",
      "b'  \\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    <li id=\"about\" class=\"tier-1 element-1  \" aria-haspopup=\"true\">\\n'\n",
      "b'        <a href=\"/about/\" title=\"\" class=\"\">About</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\" role=\"menu\" aria-hidden=\"true\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/about/apps/\" title=\"\">Applications</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/about/quotes/\" title=\"\">Quotes</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"/about/gettingstarted/\" title=\"\">Getting Started</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"/about/help/\" title=\"\">Help</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"http://brochure.getpython.info/\" title=\"\">Python Brochure</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    <li id=\"downloads\" class=\"tier-1 element-2  \" aria-haspopup=\"true\">\\n'\n",
      "b'        <a href=\"/downloads/\" title=\"\" class=\"\">Downloads</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\" role=\"menu\" aria-hidden=\"true\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/downloads/\" title=\"\">All releases</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/downloads/source/\" title=\"\">Source code</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"/downloads/windows/\" title=\"\">Windows</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"/downloads/macos/\" title=\"\">macOS</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"/download/other/\" title=\"\">Other Platforms</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-6\" role=\"treeitem\"><a href=\"https://docs.python.org/3/license.html\" title=\"\">License</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-7\" role=\"treeitem\"><a href=\"/download/alternatives\" title=\"\">Alternative Implementations</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    <li id=\"documentation\" class=\"tier-1 element-3  \" aria-haspopup=\"true\">\\n'\n",
      "b'        <a href=\"/doc/\" title=\"\" class=\"\">Documentation</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\" role=\"menu\" aria-hidden=\"true\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/doc/\" title=\"\">Docs</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/doc/av\" title=\"\">Audio/Visual Talks</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"https://wiki.python.org/moin/BeginnersGuide\" title=\"\">Beginner&#x27;s Guide</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"https://devguide.python.org/\" title=\"\">Developer&#x27;s Guide</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"https://docs.python.org/faq/\" title=\"\">FAQ</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-6\" role=\"treeitem\"><a href=\"http://wiki.python.org/moin/Languages\" title=\"\">Non-English Docs</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-7\" role=\"treeitem\"><a href=\"https://peps.python.org\" title=\"\">PEP Index</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-8\" role=\"treeitem\"><a href=\"https://wiki.python.org/moin/PythonBooks\" title=\"\">Python Books</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-9\" role=\"treeitem\"><a href=\"/doc/essays/\" title=\"\">Python Essays</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    <li id=\"community\" class=\"tier-1 element-4  \" aria-haspopup=\"true\">\\n'\n",
      "b'        <a href=\"/community/\" title=\"\" class=\"\">Community</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\" role=\"menu\" aria-hidden=\"true\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/community/diversity/\" title=\"\">Diversity</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/community/lists/\" title=\"\">Mailing Lists</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"/community/irc/\" title=\"\">IRC</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"/community/forums/\" title=\"\">Forums</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"/psf/annual-report/2021/\" title=\"\">PSF Annual Impact Report</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-6\" role=\"treeitem\"><a href=\"/community/workshops/\" title=\"\">Python Conferences</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-7\" role=\"treeitem\"><a href=\"/community/sigs/\" title=\"\">Special Interest Groups</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-8\" role=\"treeitem\"><a href=\"/community/logos/\" title=\"\">Python Logo</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-9\" role=\"treeitem\"><a href=\"https://wiki.python.org/moin/\" title=\"\">Python Wiki</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-10\" role=\"treeitem\"><a href=\"/psf/conduct/\" title=\"\">Code of Conduct</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-11\" role=\"treeitem\"><a href=\"/community/awards\" title=\"\">Community Awards</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-12\" role=\"treeitem\"><a href=\"/psf/get-involved/\" title=\"\">Get Involved</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-13\" role=\"treeitem\"><a href=\"/psf/community-stories/\" title=\"\">Shared Stories</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    <li id=\"success-stories\" class=\"tier-1 element-5  \" aria-haspopup=\"true\">\\n'\n",
      "b'        <a href=\"/success-stories/\" title=\"success-stories\" class=\"\">Success Stories</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\" role=\"menu\" aria-hidden=\"true\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/success-stories/category/arts/\" title=\"\">Arts</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/success-stories/category/business/\" title=\"\">Business</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"/success-stories/category/education/\" title=\"\">Education</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"/success-stories/category/engineering/\" title=\"\">Engineering</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"/success-stories/category/government/\" title=\"\">Government</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-6\" role=\"treeitem\"><a href=\"/success-stories/category/scientific/\" title=\"\">Scientific</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-7\" role=\"treeitem\"><a href=\"/success-stories/category/software-development/\" title=\"\">Software Development</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    <li id=\"news\" class=\"tier-1 element-6  \" aria-haspopup=\"true\">\\n'\n",
      "b'        <a href=\"/blogs/\" title=\"News from around the Python world\" class=\"\">News</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\" role=\"menu\" aria-hidden=\"true\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/blogs/\" title=\"Python Insider Blog Posts\">Python News</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/psf/newsletter/\" title=\"Python Software Foundation Newsletter\">PSF Newsletter</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"http://pyfound.blogspot.com/\" title=\"PSF Blog\">PSF News</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"http://pycon.blogspot.com/\" title=\"PyCon Blog\">PyCon US News</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"http://planetpython.org/\" title=\"Planet Python\">News from the Community</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    <li id=\"events\" class=\"tier-1 element-7  \" aria-haspopup=\"true\">\\n'\n",
      "b'        <a href=\"/events/\" title=\"\" class=\"\">Events</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\" role=\"menu\" aria-hidden=\"true\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/events/python-events/\" title=\"\">Python Events</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/events/python-user-group/\" title=\"\">User Group Events</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"/events/python-events/past/\" title=\"\">Python Events Archive</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"/events/python-user-group/past/\" title=\"\">User Group Events Archive</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"https://wiki.python.org/moin/PythonEventsCalendar#Submitting_an_Event\" title=\"\">Submit an Event</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'  \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'                    \\n'\n",
      "b'                </nav>\\n'\n",
      "b'\\n'\n",
      "b'                <div class=\"header-banner \"> <!-- for optional \"do-not-print\" class -->\\n'\n",
      "b'                    \\n'\n",
      "b'        <div id=\"dive-into-python\" class=\"flex-slideshow slideshow\">\\n'\n",
      "b'\\n'\n",
      "b'            <ul class=\"launch-shell menu\" id=\"launch-shell\">\\n'\n",
      "b'                <li>\\n'\n",
      "b'                    <a class=\"button prompt\" id=\"start-shell\" data-shell-container=\"#dive-into-python\" href=\"/shell/\">&gt;_\\n'\n",
      "b'                        <span class=\"message\">Launch Interactive Shell</span>\\n'\n",
      "b'                    </a>\\n'\n",
      "b'                </li>\\n'\n",
      "b'            </ul>\\n'\n",
      "b'\\n'\n",
      "b'            <ul class=\"slides menu\">\\n'\n",
      "b'                \\n'\n",
      "b'                <li>\\n'\n",
      "b'                    <div class=\"slide-code\"><pre><code><span class=\"comment\"># Python 3: Fibonacci series up to n</span>\\r\\n'\n",
      "b'>>> def fib(n):\\r\\n'\n",
      "b'>>>     a, b = 0, 1\\r\\n'\n",
      "b'>>>     while a &lt; n:\\r\\n'\n",
      "b\">>>         print(a, end=' ')\\r\\n\"\n",
      "b'>>>         a, b = b, a+b\\r\\n'\n",
      "b'>>>     print()\\r\\n'\n",
      "b'>>> fib(1000)\\r\\n'\n",
      "b'<span class=\"output\">0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987</span></code></pre></div>\\n'\n",
      "b'                    <div class=\"slide-copy\"><h1>Functions Defined</h1>\\r\\n'\n",
      "b'<p>The core of extensible programming is defining functions. Python allows mandatory and optional arguments, keyword arguments, and even arbitrary argument lists. <a href=\"//docs.python.org/3/tutorial/controlflow.html#defining-functions\">More about defining functions in Python&nbsp;3</a></p></div>\\n'\n",
      "b'                </li>\\n'\n",
      "b'                \\n'\n",
      "b'                <li>\\n'\n",
      "b'                    <div class=\"slide-code\"><pre><code><span class=\"comment\"># Python 3: List comprehensions</span>\\r\\n'\n",
      "b\">>> fruits = ['Banana', 'Apple', 'Lime']\\r\\n\"\n",
      "b'>>> loud_fruits = [fruit.upper() for fruit in fruits]\\r\\n'\n",
      "b'>>> print(loud_fruits)\\r\\n'\n",
      "b'<span class=\"output\">[\\'BANANA\\', \\'APPLE\\', \\'LIME\\']</span>\\r\\n'\n",
      "b'\\r\\n'\n",
      "b'<span class=\"comment\"># List and the enumerate function</span>\\r\\n'\n",
      "b'>>> list(enumerate(fruits))\\r\\n'\n",
      "b'<span class=\"output\">[(0, \\'Banana\\'), (1, \\'Apple\\'), (2, \\'Lime\\')]</span></code></pre></div>\\n'\n",
      "b'                    <div class=\"slide-copy\"><h1>Compound Data Types</h1>\\r\\n'\n",
      "b'<p>Lists (known as arrays in other languages) are one of the compound data types that Python understands. Lists can be indexed, sliced and manipulated with other built-in functions. <a href=\"//docs.python.org/3/tutorial/introduction.html#lists\">More about lists in Python&nbsp;3</a></p></div>\\n'\n",
      "b'                </li>\\n'\n",
      "b'                \\n'\n",
      "b'                <li>\\n'\n",
      "b'                    <div class=\"slide-code\"><pre><code><span class=\"comment\"># Python 3: Simple arithmetic</span>\\r\\n'\n",
      "b'>>> 1 / 2\\r\\n'\n",
      "b'<span class=\"output\">0.5</span>\\r\\n'\n",
      "b'>>> 2 ** 3\\r\\n'\n",
      "b'<span class=\"output\">8</span>\\r\\n'\n",
      "b'>>> 17 / 3  <span class=\"comment\"># classic division returns a float</span>\\r\\n'\n",
      "b'<span class=\"output\">5.666666666666667</span>\\r\\n'\n",
      "b'>>> 17 // 3  <span class=\"comment\"># floor division</span>\\r\\n'\n",
      "b'<span class=\"output\">5</span></code></pre></div>\\n'\n",
      "b'                    <div class=\"slide-copy\"><h1>Intuitive Interpretation</h1>\\r\\n'\n",
      "b'<p>Calculations are simple with Python, and expression syntax is straightforward: the operators <code>+</code>, <code>-</code>, <code>*</code> and <code>/</code> work as expected; parentheses <code>()</code> can be used for grouping. <a href=\"http://docs.python.org/3/tutorial/introduction.html#using-python-as-a-calculator\">More about simple math functions in Python&nbsp;3</a>.</p></div>\\n'\n",
      "b'                </li>\\n'\n",
      "b'                \\n'\n",
      "b'                <li>\\n'\n",
      "b'                    <div class=\"slide-code\"><pre><code><span class=\"comment\"># For loop on a list</span>\\r\\n'\n",
      "b'>>> numbers = [2, 4, 6, 8]\\r\\n'\n",
      "b'>>> product = 1\\r\\n'\n",
      "b'>>> for number in numbers:\\r\\n'\n",
      "b'...    product = product * number\\r\\n'\n",
      "b'... \\r\\n'\n",
      "b\">>> print('The product is:', product)\\r\\n\"\n",
      "b'<span class=\"output\">The product is: 384</span></code></pre></div>\\n'\n",
      "b'                    <div class=\"slide-copy\"><h1>All the Flow You&rsquo;d Expect</h1>\\r\\n'\n",
      "b'<p>Python knows the usual control flow statements that other languages speak &mdash; <code>if</code>, <code>for</code>, <code>while</code> and <code>range</code> &mdash; with some of its own twists, of course. <a href=\"//docs.python.org/3/tutorial/controlflow.html\">More control flow tools in Python&nbsp;3</a></p></div>\\n'\n",
      "b'                </li>\\n'\n",
      "b'                \\n'\n",
      "b'                <li>\\n'\n",
      "b'                    <div class=\"slide-code\"><pre><code><span class=\"comment\"># Simple output (with Unicode)</span>\\r\\n'\n",
      "b'>>> print(\"Hello, I\\'m Python!\")\\r\\n'\n",
      "b'<span class=\"output\">Hello, I\\'m Python!</span>\\r\\n'\n",
      "b'<span class=\"comment\"># Input, assignment</span>\\r\\n'\n",
      "b\">>> name = input('What is your name?\\\\n')\\r\\n\"\n",
      "b'<span class=\"output\">What is your name?\\r\\n'\n",
      "b'Python</span>\\r\\n'\n",
      "b\">>> print(f'Hi, {name}.')\\r\\n\"\n",
      "b'<span class=\"output\">Hi, Python.</span></code>\\r\\n'\n",
      "b'</pre></div>\\n'\n",
      "b'                    <div class=\"slide-copy\"><h1>Quick &amp; Easy to Learn</h1>\\r\\n'\n",
      "b'<p>Experienced programmers in any other language can pick up Python very quickly, and beginners find the clean syntax and indentation structure easy to learn. <a href=\"//docs.python.org/3/tutorial/\">Whet your appetite</a> with our Python&nbsp;3 overview.</p></div>\\n'\n",
      "b'                </li>\\n'\n",
      "b'                \\n'\n",
      "b'            </ul>\\n'\n",
      "b'        </div>\\n'\n",
      "b'\\n'\n",
      "b'\\n'\n",
      "b'                </div>\\n'\n",
      "b'\\n'\n",
      "b'                \\n'\n",
      "b'        <div class=\"introduction\">\\n'\n",
      "b'            <p>Python is a programming language that lets you work quickly <span class=\"breaker\"></span>and integrate systems more effectively. <a class=\"readmore\" href=\"/doc/\">Learn More</a></p>\\n'\n",
      "b'        </div>\\n'\n",
      "b'\\n'\n",
      "b'\\n'\n",
      "b'             </div><!-- end .container -->\\n'\n",
      "b'        </header>\\n'\n",
      "b'\\n'\n",
      "b'        <div id=\"content\" class=\"content-wrapper\">\\n'\n",
      "b'            <!-- Main Content Column -->\\n'\n",
      "b'            <div class=\"container\">\\n'\n",
      "b'\\n'\n",
      "b'                <section class=\"main-content \" role=\"main\">\\n'\n",
      "b'\\n'\n",
      "b'                    \\n'\n",
      "b'                    \\n'\n",
      "b'\\n'\n",
      "b'                    \\n'\n",
      "b'\\n'\n",
      "b'                    \\n'\n",
      "b'\\n'\n",
      "b'                \\n'\n",
      "b'\\n'\n",
      "b'                <div class=\"row\">\\n'\n",
      "b'\\n'\n",
      "b'                    <div class=\"small-widget get-started-widget\">\\n'\n",
      "b'                        <h2 class=\"widget-title\"><span aria-hidden=\"true\" class=\"icon-get-started\"></span>Get Started</h2>\\r\\n'\n",
      "b\"<p>Whether you're new to programming or an experienced developer, it's easy to learn and use Python.</p>\\r\\n\"\n",
      "b'<p><a href=\"/about/gettingstarted/\">Start with our Beginner&rsquo;s Guide</a></p>\\n'\n",
      "b'                    </div>\\n'\n",
      "b'\\n'\n",
      "b'                    <div class=\"small-widget download-widget\">\\n'\n",
      "b'                        <h2 class=\"widget-title\"><span aria-hidden=\"true\" class=\"icon-download\"></span>Download</h2>\\n'\n",
      "b'<p>Python source code and installers are available for download for all versions!</p>\\n'\n",
      "b'<p>Latest: <a href=\"/downloads/release/python-3132/\">Python 3.13.2</a></p>\\n'\n",
      "b'                    </div>\\n'\n",
      "b'\\n'\n",
      "b'                    <div class=\"small-widget documentation-widget\">\\n'\n",
      "b'                        <h2 class=\"widget-title\"><span aria-hidden=\"true\" class=\"icon-documentation\"></span>Docs</h2>\\r\\n'\n",
      "b\"<p>Documentation for Python's standard library, along with tutorials and guides, are available online.</p>\\r\\n\"\n",
      "b'<p><a href=\"https://docs.python.org\">docs.python.org</a></p>\\n'\n",
      "b'                    </div>\\n'\n",
      "b'\\n'\n",
      "b'                    <div class=\"small-widget jobs-widget last\">\\n'\n",
      "b'                        <h2 class=\"widget-title\"><span aria-hidden=\"true\" class=\"icon-jobs\"></span>Jobs</h2>\\r\\n'\n",
      "b\"<p>Looking for work or have a Python related position that you're trying to hire for? Our <strong>relaunched community-run job board</strong> is the place to go.</p>\\r\\n\"\n",
      "b'<p><a href=\"//jobs.python.org\">jobs.python.org</a></p>\\n'\n",
      "b'                    </div>\\n'\n",
      "b'\\n'\n",
      "b'                </div>\\n'\n",
      "b'\\n'\n",
      "b'                <div class=\"list-widgets row\">\\n'\n",
      "b'\\n'\n",
      "b'                    <div class=\"medium-widget blog-widget\">\\n'\n",
      "b'                        \\n'\n",
      "b'                        <div class=\"shrubbery\">\\n'\n",
      "b'                        \\n'\n",
      "b'                            <h2 class=\"widget-title\"><span aria-hidden=\"true\" class=\"icon-news\"></span>Latest News</h2>\\n'\n",
      "b'                            <p class=\"give-me-more\"><a href=\"https://blog.python.org\" title=\"More News\">More</a></p>\\n'\n",
      "b'                            \\n'\n",
      "b'                            <ul class=\"menu\">\\n'\n",
      "b'                                \\n'\n",
      "b'                                \\n'\n",
      "b'                                <li>\\n'\n",
      "b'<time datetime=\"2025-02-18T11:30:00.000001+00:00\"><span class=\"say-no-more\">2025-</span>02-18</time>\\n'\n",
      "b' <a href=\"https://pyfound.blogspot.com/2025/02/where-is-psf-2025-edition.html\">Where is the PSF? 2025 Edition</a></li>\\n'\n",
      "b'                                \\n'\n",
      "b'                                <li>\\n'\n",
      "b'<time datetime=\"2025-02-11T19:41:00.000001+00:00\"><span class=\"say-no-more\">2025-</span>02-11</time>\\n'\n",
      "b' <a href=\"https://pythoninsider.blogspot.com/2025/02/python-3140-alpha-5-is-out.html\">Python 3.14.0 alpha 5 is out</a></li>\\n'\n",
      "b'                                \\n'\n",
      "b'                                <li>\\n'\n",
      "b'<time datetime=\"2025-02-04T19:58:00.000001+00:00\"><span class=\"say-no-more\">2025-</span>02-04</time>\\n'\n",
      "b' <a href=\"https://pythoninsider.blogspot.com/2025/02/python-3132-and-3129-now-available.html\">Python 3.13.2 and 3.12.9 now available!</a></li>\\n'\n",
      "b'                                \\n'\n",
      "b'                                <li>\\n'\n",
      "b'<time datetime=\"2025-01-15T14:15:59.000002+00:00\"><span class=\"say-no-more\">2025-</span>01-15</time>\\n'\n",
      "b' <a href=\"https://mailchi.mp/python/python-software-foundation-july-2024-newsletter-19875956\">PSF Newsletter: Awards, Grants, &amp; PyCon US 2025!</a></li>\\n'\n",
      "b'                                \\n'\n",
      "b'                                <li>\\n'\n",
      "b'<time datetime=\"2025-01-14T16:46:00.000001+00:00\"><span class=\"say-no-more\">2025-</span>01-14</time>\\n'\n",
      "b' <a href=\"https://pythoninsider.blogspot.com/2025/01/python-3140-alpha-4-is-out.html\">Python 3.14.0 alpha 4 is out</a></li>\\n'\n",
      "b'                                \\n'\n",
      "b'                            </ul>\\n'\n",
      "b'                        </div><!-- end .shrubbery -->\\n'\n",
      "b'\\n'\n",
      "b'                    </div>\\n'\n",
      "b'\\n'\n",
      "b'                    <div class=\"medium-widget event-widget last\">\\n'\n",
      "b'                        \\n'\n",
      "b'                        <div class=\"shrubbery\">\\n'\n",
      "b'                        \\n'\n",
      "b'                            <h2 class=\"widget-title\"><span aria-hidden=\"true\" class=\"icon-calendar\"></span>Upcoming Events</h2>\\n'\n",
      "b'                            <p class=\"give-me-more\"><a href=\"/events/calendars/\" title=\"More Events\">More</a></p>\\n'\n",
      "b'                            \\n'\n",
      "b'                            <ul class=\"menu\">\\n'\n",
      "b'                                \\n'\n",
      "b'                                \\n'\n",
      "b'                                \\n'\n",
      "b'                                <li>\\n'\n",
      "b'<time datetime=\"2025-02-20T00:00:00+00:00\"><span class=\"say-no-more\">2025-</span>02-20</time>\\n'\n",
      "b' <a href=\"/events/python-user-group/1965/\">Workshop: Creating Python Communities</a></li>\\n'\n",
      "b'                                \\n'\n",
      "b'                                \\n'\n",
      "b'                                \\n'\n",
      "b'                                <li>\\n'\n",
      "b'<time datetime=\"2025-02-21T00:00:00+00:00\"><span class=\"say-no-more\">2025-</span>02-21</time>\\n'\n",
      "b' <a href=\"/events/python-user-group/1868/\">Django Girls Koforidua</a></li>\\n'\n",
      "b'                                \\n'\n",
      "b'                                \\n'\n",
      "b'                                \\n'\n",
      "b'                                <li>\\n'\n",
      "b'<time datetime=\"2025-02-22T00:00:00+00:00\"><span class=\"say-no-more\">2025-</span>02-22</time>\\n'\n",
      "b' <a href=\"/events/python-events/1874/\">DjangoCongress JP 2025</a></li>\\n'\n",
      "b'                                \\n'\n",
      "b'                                \\n'\n",
      "b'                                \\n'\n",
      "b'                                <li>\\n'\n",
      "b'<time datetime=\"2025-02-22T00:00:00+00:00\"><span class=\"say-no-more\">2025-</span>02-22</time>\\n'\n",
      "b' <a href=\"/events/python-events/1895/\">PyConf Hyderabad 2025</a></li>\\n'\n",
      "b'                                \\n'\n",
      "b'                                \\n'\n",
      "b'                                \\n'\n",
      "b'                                <li>\\n'\n",
      "b'<time datetime=\"2025-02-22T07:00:00+00:00\"><span class=\"say-no-more\">2025-</span>02-22</time>\\n'\n",
      "b' <a href=\"/events/python-user-group/1929/\">Python Weekend Abuja</a></li>\\n'\n",
      "b'                                \\n'\n",
      "b'                                \\n'\n",
      "b'                            </ul>\\n'\n",
      "b'                        </div>\\n'\n",
      "b'\\n'\n",
      "b'                    </div>\\n'\n",
      "b'\\n'\n",
      "b'                </div>\\n'\n",
      "b'\\n'\n",
      "b'                <div class=\"row\">\\n'\n",
      "b'\\n'\n",
      "b'                    <div class=\"medium-widget success-stories-widget\">\\n'\n",
      "b'                        \\n'\n",
      "b'\\n'\n",
      "b'\\n'\n",
      "b'\\n'\n",
      "b'                        <div class=\"shrubbery\">\\n'\n",
      "b'                            \\n'\n",
      "b'\\n'\n",
      "b'                            <h2 class=\"widget-title\"><span aria-hidden=\"true\" class=\"icon-success-stories\"></span>Success Stories</h2>\\n'\n",
      "b'                            <p class=\"give-me-more\"><a href=\"/success-stories/\" title=\"More Success Stories\">More</a></p>\\n'\n",
      "b'\\n'\n",
      "b'                            \\n'\n",
      "b'                            <div class=\"success-story-item\" id=\"success-story-932\">\\n'\n",
      "b'\\n'\n",
      "b'                            <blockquote>\\n'\n",
      "b'                                <a href=\"/success-stories/abridging-clinical-conversations-using-python/\">Python powers major aspects of Abridge\\xe2\\x80\\x99s ML lifecycle, including data annotation,  research and experimentation, and ML model deployment to production.</a>\\n'\n",
      "b'                            </blockquote>\\n'\n",
      "b'\\n'\n",
      "b'                            <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"quote-from\">\\n'\n",
      "b'                                <tbody>\\n'\n",
      "b'                                    <tr>\\n'\n",
      "b'                                        \\n'\n",
      "b'                                        <td><p><a href=\"/success-stories/abridging-clinical-conversations-using-python/\">Abridging clinical conversations using Python</a> <em>by Nimshi Venkat and Sandeep Konam</em></p></td>\\n'\n",
      "b'                                    </tr>\\n'\n",
      "b'                                </tbody>\\n'\n",
      "b'                            </table>\\n'\n",
      "b'                            </div>\\n'\n",
      "b'                            \\n'\n",
      "b'\\n'\n",
      "b'                        </div><!-- end .shrubbery -->\\n'\n",
      "b'\\n'\n",
      "b'                    </div>\\n'\n",
      "b'\\n'\n",
      "b'                    <div class=\"medium-widget applications-widget last\">\\n'\n",
      "b'                        <div class=\"shrubbery\">\\n'\n",
      "b'                            <h2 class=\"widget-title\"><span aria-hidden=\"true\" class=\"icon-python\"></span>Use Python for&hellip;</h2>\\r\\n'\n",
      "b'<p class=\"give-me-more\"><a href=\"/about/apps\" title=\"More Applications\">More</a></p>\\r\\n'\n",
      "b'\\r\\n'\n",
      "b'<ul class=\"menu\">\\r\\n'\n",
      "b'    <li><b>Web Development</b>:\\r\\n'\n",
      "b'        <span class=\"tag-wrapper\"><a class=\"tag\" href=\"http://www.djangoproject.com/\">Django</a>, <a class=\"tag\" href=\"http://www.pylonsproject.org/\">Pyramid</a>, <a class=\"tag\" href=\"http://bottlepy.org\">Bottle</a>, <a class=\"tag\" href=\"http://tornadoweb.org\">Tornado</a>, <a href=\"http://flask.pocoo.org/\" class=\"tag\">Flask</a>, <a class=\"tag\" href=\"http://www.web2py.com/\">web2py</a></span></li>\\r\\n'\n",
      "b'    <li><b>GUI Development</b>:\\r\\n'\n",
      "b'        <span class=\"tag-wrapper\"><a class=\"tag\" href=\"http://wiki.python.org/moin/TkInter\">tkInter</a>, <a class=\"tag\" href=\"https://wiki.gnome.org/Projects/PyGObject\">PyGObject</a>, <a class=\"tag\" href=\"http://www.riverbankcomputing.co.uk/software/pyqt/intro\">PyQt</a>, <a class=\"tag\" href=\"https://wiki.qt.io/PySide\">PySide</a>, <a class=\"tag\" href=\"https://kivy.org/\">Kivy</a>, <a class=\"tag\" href=\"http://www.wxpython.org/\">wxPython</a>, <a class=\"tag\" href=\"https://dearpygui.readthedocs.io/en/latest/\">DearPyGui</a></span></li>\\r\\n'\n",
      "b'    <li><b>Scientific and Numeric</b>:\\r\\n'\n",
      "b'        <span class=\"tag-wrapper\">\\r\\n'\n",
      "b'<a class=\"tag\" href=\"http://www.scipy.org\">SciPy</a>, <a class=\"tag\" href=\"http://pandas.pydata.org/\">Pandas</a>, <a href=\"http://ipython.org\" class=\"tag\">IPython</a></span></li>\\r\\n'\n",
      "b'    <li><b>Software Development</b>:\\r\\n'\n",
      "b'        <span class=\"tag-wrapper\"><a class=\"tag\" href=\"http://buildbot.net/\">Buildbot</a>, <a class=\"tag\" href=\"http://trac.edgewall.org/\">Trac</a>, <a class=\"tag\" href=\"http://roundup.sourceforge.net/\">Roundup</a></span></li>\\r\\n'\n",
      "b'    <li><b>System Administration</b>:\\r\\n'\n",
      "b'        <span class=\"tag-wrapper\"><a class=\"tag\" href=\"http://www.ansible.com\">Ansible</a>, <a class=\"tag\" href=\"https://saltproject.io\">Salt</a>, <a class=\"tag\" href=\"https://www.openstack.org\">OpenStack</a>, <a class=\"tag\" href=\"https://xon.sh\">xonsh</a></span></li>\\r\\n'\n",
      "b'</ul>\\n'\n",
      "b'                        </div><!-- end .shrubbery -->\\n'\n",
      "b'                    </div>\\n'\n",
      "b'\\n'\n",
      "b'                </div>\\n'\n",
      "b'\\n'\n",
      "b'                                <div class=\"psf-widget\">\\n'\n",
      "b'\\n'\n",
      "b'                    <div class=\"python-logo\"></div>\\n'\n",
      "b'                    \\n'\n",
      "b'                    <h2 class=\"widget-title\">\\r\\n'\n",
      "b'    <span class=\"prompt\">&gt;&gt;&gt;</span> <a href=\"/psf/\">Python Software Foundation</a>\\r\\n'\n",
      "b'</h2>\\r\\n'\n",
      "b'<p>The mission of the Python Software Foundation is to promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers. <a class=\"readmore\" href=\"/psf/\">Learn more</a> </p>\\r\\n'\n",
      "b'<p class=\"click-these\">\\r\\n'\n",
      "b'    <a class=\"button\" href=\"/users/membership/\">Become a Member</a>\\r\\n'\n",
      "b'    <a class=\"button\" href=\"/psf/donations/\">Donate to the PSF</a>\\r\\n'\n",
      "b'</p>\\n'\n",
      "b'                </div>\\n'\n",
      "b'\\n'\n",
      "b'\\n'\n",
      "b'\\n'\n",
      "b'\\n'\n",
      "b'                </section>\\n'\n",
      "b'\\n'\n",
      "b'                \\n'\n",
      "b'                \\n'\n",
      "b'\\n'\n",
      "b'                \\n'\n",
      "b'                \\n'\n",
      "b'\\n'\n",
      "b'\\n'\n",
      "b'            </div><!-- end .container -->\\n'\n",
      "b'        </div><!-- end #content .content-wrapper -->\\n'\n",
      "b'\\n'\n",
      "b'        <!-- Footer and social media list -->\\n'\n",
      "b'        \\n'\n",
      "b'        <footer id=\"site-map\" class=\"main-footer\" role=\"contentinfo\">\\n'\n",
      "b'            <div class=\"main-footer-links\">\\n'\n",
      "b'                <div class=\"container\">\\n'\n",
      "b'\\n'\n",
      "b'                    \\n'\n",
      "b'                    <a id=\"back-to-top-1\" class=\"jump-link\" href=\"#python-network\"><span aria-hidden=\"true\" class=\"icon-arrow-up\"><span>&#9650;</span></span> Back to Top</a>\\n'\n",
      "b'\\n'\n",
      "b'                    \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"sitemap navigation menu do-not-print\" role=\"tree\" id=\"container\">\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"tier-1 element-1\">\\n'\n",
      "b'        <a href=\"/about/\" >About</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/about/apps/\" title=\"\">Applications</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/about/quotes/\" title=\"\">Quotes</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"/about/gettingstarted/\" title=\"\">Getting Started</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"/about/help/\" title=\"\">Help</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"http://brochure.getpython.info/\" title=\"\">Python Brochure</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"tier-1 element-2\">\\n'\n",
      "b'        <a href=\"/downloads/\" >Downloads</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/downloads/\" title=\"\">All releases</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/downloads/source/\" title=\"\">Source code</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"/downloads/windows/\" title=\"\">Windows</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"/downloads/macos/\" title=\"\">macOS</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"/download/other/\" title=\"\">Other Platforms</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-6\" role=\"treeitem\"><a href=\"https://docs.python.org/3/license.html\" title=\"\">License</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-7\" role=\"treeitem\"><a href=\"/download/alternatives\" title=\"\">Alternative Implementations</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"tier-1 element-3\">\\n'\n",
      "b'        <a href=\"/doc/\" >Documentation</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/doc/\" title=\"\">Docs</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/doc/av\" title=\"\">Audio/Visual Talks</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"https://wiki.python.org/moin/BeginnersGuide\" title=\"\">Beginner&#x27;s Guide</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"https://devguide.python.org/\" title=\"\">Developer&#x27;s Guide</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"https://docs.python.org/faq/\" title=\"\">FAQ</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-6\" role=\"treeitem\"><a href=\"http://wiki.python.org/moin/Languages\" title=\"\">Non-English Docs</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-7\" role=\"treeitem\"><a href=\"https://peps.python.org\" title=\"\">PEP Index</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-8\" role=\"treeitem\"><a href=\"https://wiki.python.org/moin/PythonBooks\" title=\"\">Python Books</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-9\" role=\"treeitem\"><a href=\"/doc/essays/\" title=\"\">Python Essays</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"tier-1 element-4\">\\n'\n",
      "b'        <a href=\"/community/\" >Community</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/community/diversity/\" title=\"\">Diversity</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/community/lists/\" title=\"\">Mailing Lists</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"/community/irc/\" title=\"\">IRC</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"/community/forums/\" title=\"\">Forums</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"/psf/annual-report/2021/\" title=\"\">PSF Annual Impact Report</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-6\" role=\"treeitem\"><a href=\"/community/workshops/\" title=\"\">Python Conferences</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-7\" role=\"treeitem\"><a href=\"/community/sigs/\" title=\"\">Special Interest Groups</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-8\" role=\"treeitem\"><a href=\"/community/logos/\" title=\"\">Python Logo</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-9\" role=\"treeitem\"><a href=\"https://wiki.python.org/moin/\" title=\"\">Python Wiki</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-10\" role=\"treeitem\"><a href=\"/psf/conduct/\" title=\"\">Code of Conduct</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-11\" role=\"treeitem\"><a href=\"/community/awards\" title=\"\">Community Awards</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-12\" role=\"treeitem\"><a href=\"/psf/get-involved/\" title=\"\">Get Involved</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-13\" role=\"treeitem\"><a href=\"/psf/community-stories/\" title=\"\">Shared Stories</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"tier-1 element-5\">\\n'\n",
      "b'        <a href=\"/success-stories/\" title=\"success-stories\">Success Stories</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/success-stories/category/arts/\" title=\"\">Arts</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/success-stories/category/business/\" title=\"\">Business</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"/success-stories/category/education/\" title=\"\">Education</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"/success-stories/category/engineering/\" title=\"\">Engineering</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"/success-stories/category/government/\" title=\"\">Government</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-6\" role=\"treeitem\"><a href=\"/success-stories/category/scientific/\" title=\"\">Scientific</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-7\" role=\"treeitem\"><a href=\"/success-stories/category/software-development/\" title=\"\">Software Development</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"tier-1 element-6\">\\n'\n",
      "b'        <a href=\"/blogs/\" title=\"News from around the Python world\">News</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/blogs/\" title=\"Python Insider Blog Posts\">Python News</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/psf/newsletter/\" title=\"Python Software Foundation Newsletter\">PSF Newsletter</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"http://pyfound.blogspot.com/\" title=\"PSF Blog\">PSF News</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"http://pycon.blogspot.com/\" title=\"PyCon Blog\">PyCon US News</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"http://planetpython.org/\" title=\"Planet Python\">News from the Community</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"tier-1 element-7\">\\n'\n",
      "b'        <a href=\"/events/\" >Events</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"/events/python-events/\" title=\"\">Python Events</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"/events/python-user-group/\" title=\"\">User Group Events</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"/events/python-events/past/\" title=\"\">Python Events Archive</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"/events/python-user-group/past/\" title=\"\">User Group Events Archive</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"https://wiki.python.org/moin/PythonEventsCalendar#Submitting_an_Event\" title=\"\">Submit an Event</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'    <li class=\"tier-1 element-8\">\\n'\n",
      "b'        <a href=\"/dev/\" >Contributing</a>\\n'\n",
      "b'        \\n'\n",
      "b'            \\n'\n",
      "b'\\n'\n",
      "b'<ul class=\"subnav menu\">\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-1\" role=\"treeitem\"><a href=\"https://devguide.python.org/\" title=\"\">Developer&#x27;s Guide</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-2\" role=\"treeitem\"><a href=\"https://github.com/python/cpython/issues\" title=\"\">Issue Tracker</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-3\" role=\"treeitem\"><a href=\"https://mail.python.org/mailman/listinfo/python-dev\" title=\"\">python-dev list</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-4\" role=\"treeitem\"><a href=\"/dev/core-mentorship/\" title=\"\">Core Mentorship</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'        <li class=\"tier-2 element-5\" role=\"treeitem\"><a href=\"/dev/security/\" title=\"\">Report a Security Issue</a></li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'        \\n'\n",
      "b'    </li>\\n'\n",
      "b'    \\n'\n",
      "b'</ul>\\n'\n",
      "b'\\n'\n",
      "b'\\n'\n",
      "b'                    <a id=\"back-to-top-2\" class=\"jump-link\" href=\"#python-network\"><span aria-hidden=\"true\" class=\"icon-arrow-up\"><span>&#9650;</span></span> Back to Top</a>\\n'\n",
      "b'                    \\n'\n",
      "b'\\n'\n",
      "b'                </div><!-- end .container -->\\n'\n",
      "b'            </div> <!-- end .main-footer-links -->\\n'\n",
      "b'\\n'\n",
      "b'            <div class=\"site-base\">\\n'\n",
      "b'                <div class=\"container\">\\n'\n",
      "b'                    \\n'\n",
      "b'                    <ul class=\"footer-links navigation menu do-not-print\" role=\"tree\">\\n'\n",
      "b'                        <li class=\"tier-1 element-1\"><a href=\"/about/help/\">Help &amp; <span class=\"say-no-more\">General</span> Contact</a></li>\\n'\n",
      "b'                        <li class=\"tier-1 element-2\"><a href=\"/community/diversity/\">Diversity <span class=\"say-no-more\">Initiatives</span></a></li>\\n'\n",
      "b'                        <li class=\"tier-1 element-3\"><a href=\"https://github.com/python/pythondotorg/issues\">Submit Website Bug</a></li>\\n'\n",
      "b'                        <li class=\"tier-1 element-4\">\\n'\n",
      "b'                            <a href=\"https://status.python.org/\">Status <span class=\"python-status-indicator-default\" id=\"python-status-indicator\"></span></a>\\n'\n",
      "b'                        </li>\\n'\n",
      "b'                    </ul>\\n'\n",
      "b'\\n'\n",
      "b'                    <div class=\"copyright\">\\n'\n",
      "b'                        <p><small>\\n'\n",
      "b'                            <span class=\"pre\">Copyright &copy;2001-2025.</span>\\n'\n",
      "b'                            &nbsp;<span class=\"pre\"><a href=\"/psf-landing/\">Python Software Foundation</a></span>\\n'\n",
      "b'                            &nbsp;<span class=\"pre\"><a href=\"/about/legal/\">Legal Statements</a></span>\\n'\n",
      "b'                            &nbsp;<span class=\"pre\"><a href=\"https://policies.python.org/python.org/Privacy-Notice/\">Privacy Notice</a></span>\\n'\n",
      "b'                            <!--&nbsp;<span class=\"pre\"><a href=\"/psf/community-infrastructure\">Powered by PSF Community Infrastructure</a></span>-->\\n'\n",
      "b'                        </small></p>\\n'\n",
      "b'                    </div>\\n'\n",
      "b'\\n'\n",
      "b'                </div><!-- end .container -->\\n'\n",
      "b'            </div><!-- end .site-base -->\\n'\n",
      "b'\\n'\n",
      "b'        </footer>\\n'\n",
      "b'        \\n'\n",
      "b'\\n'\n",
      "b'    </div><!-- end #touchnav-wrapper -->\\n'\n",
      "b'\\n'\n",
      "b'    \\n'\n",
      "b'    <script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js\"></script>\\n'\n",
      "b'    <script>window.jQuery || document.write(\\'<script src=\"/static/js/libs/jquery-1.8.2.min.js\"><\\\\/script>\\')</script>\\n'\n",
      "b'    <script src=\"//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js\"></script>\\n'\n",
      "b'    <script>window.jQuery || document.write(\\'<script src=\"/static/js/libs/jquery-ui-1.12.1.min.js\"><\\\\/script>\\')</script>\\n'\n",
      "b'\\n'\n",
      "b'    <script src=\"/static/js/libs/masonry.pkgd.min.js\"></script>\\n'\n",
      "b'    <script src=\"/static/js/libs/html-includes.js\"></script>\\n'\n",
      "b'\\n'\n",
      "b'    <script type=\"text/javascript\" src=\"/static/js/main-min.ef82c06437cf.js\" charset=\"utf-8\"></script>\\n'\n",
      "b'    \\n'\n",
      "b'\\n'\n",
      "b'    <!--[if lte IE 7]>\\n'\n",
      "b'    <script type=\"text/javascript\" src=\"/static/js/plugins/IE8-min.8af6e26c7a3b.js\" charset=\"utf-8\"></script>\\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    <![endif]-->\\n'\n",
      "b'\\n'\n",
      "b'    <!--[if lte IE 8]>\\n'\n",
      "b'    <script type=\"text/javascript\" src=\"/static/js/plugins/getComputedStyle-min.d41d8cd98f00.js\" charset=\"utf-8\"></script>\\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'    <![endif]-->\\n'\n",
      "b'\\n'\n",
      "b'    \\n'\n",
      "b'\\n'\n",
      "b'    \\n'\n",
      "b'    \\n'\n",
      "b'\\n'\n",
      "b'</body>\\n'\n",
      "b'</html>\\n'\n"
     ]
    }
   ],
   "source": [
    "from contextlib import closing \n",
    "from urllib.request import urlopen\n",
    "\n",
    "with closing(urlopen('https://www.python.org')) as page:\n",
    "    for line in page:\n",
    "        print(line)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "7b2366ea-7bed-4797-b7c0-f31716804c26",
   "metadata": {},
   "outputs": [],
   "source": [
    "from contextlib import suppress\n",
    "\n",
    "with suppress(FileNotFoundError):\n",
    "    with open('1.text') as files:\n",
    "        for lin in files:\n",
    "            print(line)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "9fb83985-c435-4284-9479-5973dfc978d4",
   "metadata": {},
   "outputs": [
    {
     "ename": "FileNotFoundError",
     "evalue": "[Errno 2] No such file or directory: '1.text'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mFileNotFoundError\u001b[0m                         Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[9], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m1.text\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mas\u001b[39;00m files:\n\u001b[0;32m      2\u001b[0m     \u001b[38;5;28;01mfor\u001b[39;00m lin \u001b[38;5;129;01min\u001b[39;00m files:\n\u001b[0;32m      3\u001b[0m         \u001b[38;5;28mprint\u001b[39m(line)\n",
      "File \u001b[1;32m~\\.conda\\envs\\chatgpt\\lib\\site-packages\\IPython\\core\\interactiveshell.py:310\u001b[0m, in \u001b[0;36m_modified_open\u001b[1;34m(file, *args, **kwargs)\u001b[0m\n\u001b[0;32m    303\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m file \u001b[38;5;129;01min\u001b[39;00m {\u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m2\u001b[39m}:\n\u001b[0;32m    304\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[0;32m    305\u001b[0m         \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mIPython won\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt let you open fd=\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mfile\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m by default \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m    306\u001b[0m         \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mas it is likely to crash IPython. If you know what you are doing, \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m    307\u001b[0m         \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124myou can use builtins\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m open.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m    308\u001b[0m     )\n\u001b[1;32m--> 310\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m io_open(file, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
      "\u001b[1;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '1.text'"
     ]
    }
   ],
   "source": [
    "with open('1.text') as files:\n",
    "    for lin in files:\n",
    "        print(line)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "b6068a4f-8f72-4892-8a2d-0eaafde024be",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function pow in module builtins:\n",
      "\n",
      "pow(base, exp, mod=None)\n",
      "    Equivalent to base**exp with 2 arguments or base**exp % mod with 3 arguments\n",
      "    \n",
      "    Some types, such as ints, are able to use a more efficient algorithm when\n",
      "    invoked using the three argument form.\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "from contextlib import redirect_stdout\n",
    "from io import StringIO\n",
    "\n",
    "with redirect_stdout(StringIO()) as f:\n",
    "    help(pow)\n",
    "s =f.getvalue()\n",
    "print(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "957b77c1-1d0f-40eb-a449-d02e4e6ff93b",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('help.txt', 'w') as f:\n",
    "    with redirect_stdout(f):\n",
    "        help(pow)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "a748689b-0ed9-46f2-9ec4-0fc51f6514e0",
   "metadata": {},
   "outputs": [],
   "source": [
    "from contextlib import ExitStack\n",
    "\n",
    "filenames = [\"1.txt\", \"2.txt\"]\n",
    "with ExitStack() as stack:\n",
    "    fileObject = [stack.enter_context(open(filename)) for filename in filenames]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "032c0dd7-d14d-41ff-ac78-48b6f3c9d24e",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.21"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
